package com.yan.arrays;

import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
        int num;
        Scanner input = new Scanner(System.in);
        System.out.println("请输入一个整数");
        num = input.nextInt();
        int count = getBit(num);
        System.out.println(num + "是"+count+"位数");
    }

    public static int getBit(int num){
        int count = 0;
        if(num < 0){
            num = - num;
        }
        while(num > 0){
            num = num / 10;
            count++;
        }
        return count;
    }
}
